import {KeyRange} from "./Const";
import Database from "./Database";
class Driver extends Database {
    insert (table:string, data:Array<any>) {
        return this.table(table).insert(data)
    }

    select (table:string, keyRange?:KeyRange, limit?:number) {
        return this.table(table).query(keyRange, limit)
    }

    selectByKey(table:string, key:any) {
        return this.table(table).queryByKey(key)
    }

    count (table:string, keyRange?:KeyRange) {
        return this.table(table).count(keyRange)
    }

    update (table:string, modify:any, where:any) {
        return this.table(table).update(modify, where)
    }

    delete (table:string, key:any) {
        return this.table(table).delete(key)
    }

    truncate(table:string) {
        return this.table(table).clear()
    }
}

export default Driver;
